package com.ruoyi.project.hissystem.service.impl;

import com.ruoyi.project.hissystem.domain.HisDepartment;
import com.ruoyi.project.hissystem.mapper.HisDepartmentMapper;
import com.ruoyi.project.hissystem.service.HisDepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author : 杨磊
 * @date : 21:49 2021/8/17
 */

@Service
public class HisDepartmentServiceImpl implements HisDepartmentService {

    //声明mapper层属性
    @Autowired
    private HisDepartmentMapper hisDepartmentMapper;

    /**
     * 动态查询科室信息
     * @param hisDepartment 科室信息
     * @return
     */
    @Override
    public List<HisDepartment> selectDepartmentList(HisDepartment hisDepartment) {
        return hisDepartmentMapper.selectDepartmentList(hisDepartment);
    }

    /**
     * 科室新增
     * @param hisDepartment 科室信息
     * @return
     */
    @Override
    public int insertDepartment(HisDepartment hisDepartment) {
        return hisDepartmentMapper.insertDepartment(hisDepartment);
    }

    /**
     * 根据科室Id 查询科室信息
     * @param departId 科室ID
     * @return
     */
    @Override
    public HisDepartment selectDepartmentById(Long departId) {
        return hisDepartmentMapper.selectDepartmentById(departId);
    }

    /**
     * 科室修改
     * @param hisDepartment 科室信息
     * @return
     */
    @Override
    public int updateDepartment(HisDepartment hisDepartment) {
        return hisDepartmentMapper.updateDepartment(hisDepartment);
    }

    /**
     * 批量删除科室信息
     * @param departIds 需要删除的科室ID
     * @return
     */
    @Override
    public int deleteDepartmentByIds(Long[] departIds) {
        return hisDepartmentMapper.deleteDepartmentByIds(departIds);
    }
}
